package com.gdcp;

import com.gdcp.common.PlatformEnum;
import com.gdcp.config.annotation.BussinessLog;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

/**
 * @author 杨华京
 * @version 1.0
 * @description
 * @since 1.8
 */
@Controller
public class RenderController {


    @BussinessLog(value = "进入首页")
    @RequestMapping(value = "/",method = RequestMethod.GET)
    public String index(){
        return "redirect:/render/product/index";
    }

    @BussinessLog(value = "进入error(500)")
    @RequestMapping(value = "/error",method = RequestMethod.GET)
    public String error(){
        return "frontend/error";
    }

    @BussinessLog(value = "进入登录")
    @RequestMapping(value = "/render/login",method = RequestMethod.GET)
    public String login(){
        return "frontend/login";
    }

    @BussinessLog(value = "进入个人中心")
    @RequestMapping(value = "/render/myhome",method = RequestMethod.GET)
    public String myhome(){
        return "frontend/myhome";
    }

    @BussinessLog(value = "进入注册")
    @RequestMapping(value = "/render/register",method = RequestMethod.GET)
    public String register(){
        return "frontend/register";
    }

    @BussinessLog(value = "进入个人密码编辑")
    @RequestMapping(value = "/render/password_edit",method = RequestMethod.GET)
    public String findPassword(){
        return "frontend/password_edit";
    }

    @BussinessLog(value = "进入个人地址")
    @RequestMapping(value = "/render/address",method = RequestMethod.GET)
    public String address(){
        return "redirect:shipping/address";
    }

    @BussinessLog(value = "进入个人地址编辑")
    @RequestMapping(value = "/render/address_edit",method = RequestMethod.GET)
    public String address_edit(){
        return "frontend/address_edit";
    }

    @BussinessLog(value = "进入购物车")
    @RequestMapping(value = "/render/flow",method = RequestMethod.GET)
    public String flow(){
        return "redirect:/render/cart/flow";
    }

    @BussinessLog(value = "进入登录")
    @RequestMapping(value = "/render/flow_end",method = RequestMethod.GET)
    public String flow_end(){
        return "frontend/flow_end";
    }

    @BussinessLog(value = "进入个人收藏")
    @RequestMapping(value = "/render/favorite",method = RequestMethod.GET)
    public String favorite(){
        return "redirect:/render/collection/favorite";
    }

    @BussinessLog(value = "进入分类")
    @RequestMapping(value = "/render/list",method = RequestMethod.GET)
    public String list(){
        return "redirect:/render/product/list";
    }

   /* @BussinessLog(value = "进入我的订单")
    @RequestMapping(value = "/render/order",method = RequestMethod.GET)
    public String order(){
        return "redirect:/render/order/myorder";
    }*/

    @BussinessLog(value = "进入我的评论")
    @RequestMapping(value = "/render/comment",method = RequestMethod.GET)
    public String comment(){
        return "redirect:/render/comment/list";
    }

    @BussinessLog(value = "进入我的订单")
    @RequestMapping(value = "/render/myorder",method = RequestMethod.GET)
    public String member(){
        return "redirect:/render/order/myorder";
    }

    //@RequestMapping(value = "/product_info",method = RequestMethod.GET)
    //public String product_info(){
    //    return "redirect:/render/product/product_detail";
    //}

    @BussinessLog(value = "进入店铺")
    @RequestMapping(value = "/render/shop",method = RequestMethod.GET)
    public String shop(){
        return "redirect:/render/shop/queryShopByShopId";
    }

/*----------------------------------------------后台管理--------------------------------------------------*/

    @BussinessLog(value = "进入用户管理", platform = PlatformEnum.ADMIN)
    @RequestMapping(value = "/render/userManager",method = RequestMethod.GET)
    public String userManager(){
        return "admin/userManager";
    }

    @BussinessLog(value = "进入分类管理", platform = PlatformEnum.ADMIN)
    @RequestMapping(value = "/render/categoryManager",method = RequestMethod.GET)
    public String categoryManager(){
        return "redirect:categoryManager/queryByAll";
    }

    @BussinessLog(value = "进入商品管理", platform = PlatformEnum.ADMIN)
    @RequestMapping(value = "/render/productManager",method = RequestMethod.GET)
    public String listCategory(){
        return "redirect:productManager/queryByParentId";
    }

    @BussinessLog(value = "进入订单管理", platform = PlatformEnum.ADMIN)
    @RequestMapping(value = "/render/orderManager",method = RequestMethod.GET)
    public String ordersManager(){
        return "admin/orderManager";
    }

    @BussinessLog(value = "进入订单子项管理", platform = PlatformEnum.ADMIN)
    @RequestMapping(value = "/render/orderitemManager",method = RequestMethod.GET)
    public String orderitemManager(){
        return "admin/orderitemManager";
    }

    @BussinessLog(value = "进入banner管理", platform = PlatformEnum.ADMIN)
    @RequestMapping(value = "/render/bannerManager",method = RequestMethod.GET)
    public String bannerManager(){
        return "admin/bannerManager";
    }

    @BussinessLog(value = "进入商铺店家管理", platform = PlatformEnum.ADMIN)
    @RequestMapping(value = "/render/shopManager",method = RequestMethod.GET)
    public String shopManager(){
        return "redirect:/render/shopManager/queryByShopId";
    }

    @BussinessLog(value = "进入商铺后台管理", platform = PlatformEnum.ADMIN)
    @RequestMapping(value = "/render/shopManager_admin",method = RequestMethod.GET)
    public String shopManager_admin(){
        return "admin/shopManager_admin";
    }

    @BussinessLog(value = "进入新闻管理", platform = PlatformEnum.ADMIN)
    @RequestMapping(value = "/render/newsManager",method = RequestMethod.GET)
    public String newsManager(){
        return "admin/newsManager";
    }

    @BussinessLog(value = "进入评论管理", platform = PlatformEnum.ADMIN)
    @RequestMapping(value = "/render/commentManager",method = RequestMethod.GET)
    public String commentManager(){
        return "admin/commentManager";
    }

    @BussinessLog(value = "进入权限管理", platform = PlatformEnum.ADMIN)
    @RequestMapping(value = "/render/roleuserManager",method = RequestMethod.GET)
    public String roleuserManager(){
        return "admin/roleuserManager";
    }
}